#{extends 'main.html' /}
#{set title:'Toutes les taches' /}

<table>
	<thead>
		<tr>
			<th class="id">Id</th>
			<th class="contrat">Contrat</th>
			<th class="description">Description</th>
			<th class="budget">Budget</th>
			<th class="statut">Statut</th>
		</tr>
	</thead>
	<tbody>
	    #{list taches, as:'tache'}
	    <tr class="tache" tacheId="${tache.idTache}" draggable="true">
   			<td id="contrat-${tache.idTache}">${tache.codeContrat}</td>
   			<td id="description-${tache.idTache}">${tache.description}</td>
   			<td id="budget-${tache.idTache}">${tache.budgetInitial}</td>
   			<td id="statut-${tache.idTache}">${tache.statut}</td>
   			<td><a href="/taches/show?id=${tache.idTache}">&gt;</a></td>
   		</tr>
	    #{/list}
	    <tr>
	        #{form @save()}
	        <td><input type="text" name="tache.codeContrat"></td>
	        <td><input type="text" name="tache.description"></td>
	        <td><input type="text" name="tache.budgetInitial"></td>
	        <td><input type="text" name="tache.statut"></td>
	        <td><input type="submit" value="+"></td>
	        #{/form}
	    </tr>
	</tbody>
</table>